import 'dart:math';

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class IconTextArrowITView extends StatelessWidget {
  final title;
  final VoidCallback callback;
  final Color color;

  final String rightText;
  final String rightIcon;

  IconTextArrowITView(this.title, this.color, this.callback,
      {this.rightIcon, this.rightText});

  @override
  Widget build(BuildContext context) {
    return Container(
        color: Colors.white,
        height: ScreenUtil.getInstance().setHeight(100.0),
        width: double.infinity,
        child: InkWell(
          onTap: callback,
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Padding(
                padding: EdgeInsets.only(
                    left: ScreenUtil.getInstance().setWidth(30.0)),
              ),
              Text(
                title,
                style: TextStyle(
                    fontSize: ScreenUtil.getInstance().setSp(26.0),
                    color: Colors.black54),
              ),
              Expanded(child: Container()),
              rightText == null
                  ? Container()
                  : Text(
                      rightText,
                      style: TextStyle(
                          fontSize: ScreenUtil.getInstance().setSp(26.0),
                          color: Colors.black54),
                    ),
              rightIcon == null
                  ? Container()
                  : CircleAvatar(
                      radius: ScreenUtil.getInstance().setWidth(30),
                      backgroundImage: NetworkImage(
                        rightIcon,
                      ),
                    ),
              Padding(
                padding: const EdgeInsets.only(left: 5, right: 15),
                child: Icon(
                  Icons.arrow_forward_ios,
                  color: Colors.grey,
                  size: ScreenUtil.getInstance().setWidth(30),
                ),
              )
            ],
          ),
        ));
  }
}
